/*
 * Copyright (c) 2011-2014, fortiss GmbH.
 * Licensed under the Apache License, Version 2.0.
 *
 * Use, modification and distribution are subject to the terms specified
 * in the accompanying license file LICENSE.txt located at the root directory
 * of this software distribution. A copy is available at
 * http://chromosome.fortiss.org/.
 *
 * This file is part of CHROMOSOME.
 *
 * $Id: deviceComponent.c 7554 2014-02-21 14:33:38Z wiesmueller $
 */

/**
 * \file
 *         Source file for device component.
 *
 * \author
 *         This file has been generated by the CHROMOSOME Modeling Tool (XMT)
 *         (fortiss GmbH).
 */

/******************************************************************************/
/***   Includes                                                             ***/
/******************************************************************************/
#include "detector/adv/device/include/deviceComponent.h"

// PROTECTED REGION ID(DETECTOR_ADV_DEVICE_DEVICECOMPONENT_C_INCLUDES) ENABLED START
#include "xme/core/log.h"

#include "xme/hal/include/safeString.h" //TODO
// PROTECTED REGION END

/******************************************************************************/
/***   Defines                                                              ***/
/******************************************************************************/

// PROTECTED REGION ID(DETECTOR_ADV_DEVICE_DEVICECOMPONENT_C_DEFINES) ENABLED START
// PROTECTED REGION END

/******************************************************************************/
/***   Type definitions                                                     ***/
/******************************************************************************/

// PROTECTED REGION ID(DETECTOR_ADV_DEVICE_DEVICECOMPONENT_C_TYPE_DEFINITIONS) ENABLED START
// PROTECTED REGION END

/******************************************************************************/
/***   Variables                                                            ***/
/******************************************************************************/

// PROTECTED REGION ID(DETECTOR_ADV_DEVICE_DEVICECOMPONENT_C_VARIABLES) ENABLED START
// PROTECTED REGION END

/******************************************************************************/
/***   Prototypes                                                           ***/
/******************************************************************************/

// PROTECTED REGION ID(DETECTOR_ADV_DEVICE_DEVICECOMPONENT_C_PROTOTYPES) ENABLED START
// PROTECTED REGION END

/******************************************************************************/
/***   Implementation                                                       ***/
/******************************************************************************/
xme_status_t
detector_adv_device_deviceComponent_init
(
    detector_adv_device_deviceComponent_config_t* const config,
    const char* initializationString
)
{
    // PROTECTED REGION ID(DETECTOR_ADV_DEVICE_DEVICECOMPONENT_C_INITIALIZE) ENABLED START
    XME_CHECK_MSG(NULL != initializationString, XME_STATUS_INVALID_CONFIGURATION, XME_LOG_ERROR, "[deviceComponent] Initialization string must not be NULL.\n");
    
    xme_hal_safeString_strncpy(config->name, initializationString, sizeof(config->name));
    config->counter = 0;

    return XME_STATUS_SUCCESS;
    // PROTECTED REGION END
}

void
detector_adv_device_deviceComponent_fini
(
    detector_adv_device_deviceComponent_config_t* const config
)
{
    // PROTECTED REGION ID(DETECTOR_ADV_DEVICE_DEVICECOMPONENT_C_FINALIZE) ENABLED START
    XME_UNUSED_PARAMETER(config);
    // PROTECTED REGION END
}

// PROTECTED REGION ID(DETECTOR_ADV_DEVICE_DEVICECOMPONENT_C_IMPLEMENTATION) ENABLED START
// PROTECTED REGION END
